import { useState } from 'react';
import ExpensiveCpn from './ExpensiveCpn'

// number 的每次改动，都会造成子组件 ExpensiveCpn 的重新渲染
export default function Demo01() {
  const [number, setNumber] = useState(0)

  return (
    <div className={"ex" + number}>
      <input type="button" value={number} onClick={(e) => setNumber(number + 1)} />
      <p>number is {number}</p>
      <ExpensiveCpn />
    </div>
  )
}